---
title: Logging & Debugging
layout: page
pageOrder: 5
section: 'General'
subsection: true
sitemap:
priority: 0.7
changefreq: 'monthly'
lastmod: 2019-11-10T08:00:00+01:00
---

<p>MockServer supports the following features to simplify debugging</p>

<ul>
    <li>A <a href="/mock_server/mockserver_ui.html">UI</a> to easily view logs, active expectations, received requests and proxied requests</li>
    <li>
        <p>Retrieve the following items:</p>
        <ul>
            <li><strong><a href="#retrieving_active_expectations">active expectations</a></strong></li>
            <li><strong><a href="#retrieving_recorded_expectations">recorded expectations</a></strong></li>
            <li><strong><a href="#retrieving_recorded_requests">recorded requests</a></strong></li>
            <li><strong><a href="#retrieving_recorded_request_responses">recorded requests and responses</a></strong></li>
            <li><strong><a href="#retrieving_recorded_logs">logs</a></strong></li>
        </ul>
    </li>
    <li>Configurable <a href="#logging-levels">log level</a></li>
    <li>Clear and simple log messages for all actions</li>
    <li>JSON Schema validation of all requests to the REST API, with clear failure messages</li>
    <li>Clear failure messages when verifying requests (that support "show difference" in IntelliJ)</li>
</ul>

<h2 style="color: #9c0000;"><strong>The simplest way to debug MockServer is to use the <a href="/mock_server/mockserver_ui.html">UI</a> to view logs, requests and expectations</strong></h2>

<a id="retrieving_active_expectations" class="anchor" href="#retrieving_active_expectations">&nbsp;</a>

<h2>Retrieving Active Expectations</h2>

<p>It is possible to retrieve the active expectations, as show below in the code examples.</p>

<p>Expectations are returned in the order they have been added. The expectations are returned can be filter using a <a href="/mock_server/getting_started.html#request_matchers">request matcher</a>.</p>

<button id="button_active_expectations" class="accordion title"><strong>Retrieving Active Expectations Code Examples</strong></button>
<div class="panel title">
    <button id="button_retrieve_all_active_expectations" class="accordion">retrieve all active expectations</button>
    <div class="panel">
        <button class="accordion inner">Java</button>
        <div class="panel">
            <pre class="prettyprint lang-java code"><code class="code">Expectation[] activeExpectations = new MockServerClient("localhost", 1080)
    .retrieveActiveExpectations(
        request()
    );</code></pre>
        </div>
        <button class="accordion inner">JavaScript</button>
        <div class="panel">
            <pre class="prettyprint lang-javascript code"><code class="code">var mockServerClient = require('mockserver-client').mockServerClient;
mockServerClient("localhost", 1080)
    .retrieveActiveExpectations({})
    .then(
        function (activeExpectations) {
            console.log(JSON.stringify(activeExpectations));
        },
        function (error) {
            console.log(error);
        }
    );</code></pre>
            <p>See <a target="_blank" href="https://app.swaggerhub.com/apis/jamesdbloom/mock-server-openapi/{{ site.mockserver_api_version }}#/control/put_retrieve" target="_blank">REST API</a> for full JSON specification</p>
        </div>
        <button class="accordion inner">REST API</button>
        <div class="panel">
            <pre class="prettyprint code"><code class="code">curl -v -X PUT "http://localhost:1080/mockserver/retrieve?type=ACTIVE_EXPECTATIONS"</code></pre>
            <p>See <a target="_blank" href="https://app.swaggerhub.com/apis/jamesdbloom/mock-server-openapi/{{ site.mockserver_api_version }}#/control/put_retrieve" target="_blank">REST API</a> for full JSON specification</p>
        </div>
    </div>
    <button id="button_retrieve_active_expectations_using_request_matcher" class="accordion">retrieve active expectations using request matcher</button>
    <div class="panel">
        <button class="accordion inner">Java</button>
        <div class="panel">
            <pre class="prettyprint lang-java code"><code class="code">Expectation[] activeExpectations = new MockServerClient("localhost", 1080)
    .retrieveActiveExpectations(
        request()
            .withPath("/some/path")
            .withMethod("POST")
    );</code></pre>
        </div>
        <button class="accordion inner">JavaScript</button>
        <div class="panel">
            <pre class="prettyprint lang-javascript code"><code class="code">var mockServerClient = require('mockserver-client').mockServerClient;
mockServerClient("localhost", 1080).retrieveActiveExpectations({
    "path": "/some/path",
    "method": "POST"
}).then(
    function (activeExpectations) {
        console.log(JSON.stringify(activeExpectations));
    },
    function (error) {
        console.log(error);
    }
);</code></pre>
            <p>See <a target="_blank" href="https://app.swaggerhub.com/apis/jamesdbloom/mock-server-openapi/{{ site.mockserver_api_version }}#/control/put_retrieve" target="_blank">REST API</a> for full JSON specification</p>
        </div>
        <button class="accordion inner">REST API</button>
        <div class="panel">
            <pre class="prettyprint code"><code class="code">curl -v -X PUT "http://localhost:1080/mockserver/retrieve?type=ACTIVE_EXPECTATIONS" -d '{
    "path": "/some/path",
    "method": "POST"
}'</code></pre>
            <p>See <a target="_blank" href="https://app.swaggerhub.com/apis/jamesdbloom/mock-server-openapi/{{ site.mockserver_api_version }}#/control/put_retrieve" target="_blank">REST API</a> for full JSON specification</p>
        </div>
    </div>
    <button id="button_retrieve_active_expectations_as_java" class="accordion">retrieve active expectations as java</button>
    <div class="panel">
        <button class="accordion inner">Java</button>
        <div class="panel">
            <pre class="prettyprint lang-java code"><code class="code">String activeExpectations = new MockServerClient("localhost", 1080)
    .retrieveActiveExpectations(
        request()
            .withPath("/some/path")
            .withMethod("POST"),
        Format.JAVA
    );</code></pre>
        </div>
        <button class="accordion inner">REST API</button>
        <div class="panel">
            <pre class="prettyprint code"><code class="code">curl -v -X PUT "http://localhost:1080/mockserver/retrieve?type=ACTIVE_EXPECTATIONS&format=JAVA" -d '{
    "path": "/some/path"
}'</code></pre>
            <p>See <a target="_blank" href="https://app.swaggerhub.com/apis/jamesdbloom/mock-server-openapi/{{ site.mockserver_api_version }}#/control/put_retrieve" target="_blank">REST API</a> for full JSON specification</p>
        </div>
    </div>
    <button id="button_retrieve_active_expectations_as_json" class="accordion">retrieve active expectations as json</button>
    <div class="panel">
        <button class="accordion inner">Java</button>
        <div class="panel">
            <pre class="prettyprint lang-java code"><code class="code">String activeExpectations = new MockServerClient("localhost", 1080)
    .retrieveActiveExpectations(
        request()
            .withPath("/some/path")
            .withMethod("POST"),
        Format.JSON
    );</code></pre>
        </div>
        <button class="accordion inner">JavaScript</button>
        <div class="panel">
            <pre class="prettyprint lang-javascript code"><code class="code">var mockServerClient = require('mockserver-client').mockServerClient;
mockServerClient("localhost", 1080).retrieveActiveExpectations({
    "path": "/some/path",
    "method": "POST"
}).then(
    function (activeExpectations) {
        console.log(JSON.stringify(activeExpectations));
    },
    function (error) {
        console.log(error);
    }
);</code></pre>
            <p>See <a target="_blank" href="https://app.swaggerhub.com/apis/jamesdbloom/mock-server-openapi/{{ site.mockserver_api_version }}#/control/put_retrieve" target="_blank">REST API</a> for full JSON specification</p>
        </div>
        <button class="accordion inner">REST API</button>
        <div class="panel">
            <pre class="prettyprint code"><code class="code">curl -v -X PUT "http://localhost:1080/mockserver/retrieve?type=ACTIVE_EXPECTATIONS&format=JSON" -d '{
    "path": "/some/path"
}'</code></pre>
            <p>See <a target="_blank" href="https://app.swaggerhub.com/apis/jamesdbloom/mock-server-openapi/{{ site.mockserver_api_version }}#/control/put_retrieve" target="_blank">REST API</a> for full JSON specification</p>
        </div>
    </div>
</div>

{% include_subpage _includes/retrieve_code_example.html %}

<a id="retrieving_recorded_logs" class="anchor" href="#retrieving_recorded_logs">&nbsp;</a>

<h2>Retrieving Recorded Logs</h2>

<p>MockServer and the proxy record log messages for all major actions, including:</p>
<ul>
    <li>adding expectations</li>
    <li><a href="/mock_server/getting_started.html#request_matchers">matching requests</a></li>
    <li>executing actions (<a href="/mock_server/getting_started.html#response_action">response</a>, <a href="/mock_server/getting_started.html#forward_action">forward</a>, <a href="/mock_server/getting_started.html#callback_action">callback</a>
        & <a href="/mock_server/getting_started.html#error_action">error</a>)
    </li>
    <li>returning responses</li>
    <li>clearing logs, expectations & recorded requests</li>
    <li>resetting logs, expectations & recorded requests</li>
</ul>

<p>It is possible to retrieve the recorded log messages, as show below in the code examples.</p>

<p>Log messages are returned in the order they have been recorded, and which log messages are returned can be filter using a <a href="/mock_server/getting_started.html#request_matchers">request matcher</a>.</p>

<button id="button_recorded_log_messages" class="accordion title"><strong>Retrieving Recorded Log Events Code Examples</strong></button>
<div class="panel title">
    <button id="button_retrieve_all_recorded_log_messages" class="accordion">retrieve all recorded log messages</button>
    <div class="panel">
        <button class="accordion inner">Java</button>
        <div class="panel">
            <pre class="prettyprint lang-java code"><code class="code">String logMessages = new MockServerClient("localhost", 1080)
    .retrieveLogMessages(
        request()
    );</code></pre>
        </div>
        <button class="accordion inner">JavaScript</button>
        <div class="panel">
            <pre class="prettyprint lang-javascript code"><code class="code">var mockServerClient = require('mockserver-client').mockServerClient;
mockServerClient("localhost", 1080)
    .retrieveLogMessages({})
    .then(
        function (logMessages) {
            // logMessages is a String[]
            console.log(logMessages);
        },
        function (error) {
            console.log(error);
        }
    );</code></pre>
            <p>See <a target="_blank" href="https://app.swaggerhub.com/apis/jamesdbloom/mock-server-openapi/{{ site.mockserver_api_version }}#/control/put_retrieve" target="_blank">REST API</a> for full JSON specification</p>
        </div>
        <button class="accordion inner">REST API</button>
        <div class="panel">
            <pre class="prettyprint code"><code class="code">curl -v -X PUT "http://localhost:1080/mockserver/retrieve?type=LOGS"</code></pre>
            <p>See <a target="_blank" href="https://app.swaggerhub.com/apis/jamesdbloom/mock-server-openapi/{{ site.mockserver_api_version }}#/control/put_retrieve" target="_blank">REST API</a> for full JSON specification</p>
        </div>
    </div>
    <button id="button_retrieve_recorded_log_messages_using_request_matcher" class="accordion">retrieve recorded log messages using request matcher</button>
    <div class="panel">
        <button class="accordion inner">Java</button>
        <div class="panel">
            <pre class="prettyprint lang-java code"><code class="code">String logMessages = new MockServerClient("localhost", 1080)
    .retrieveLogMessages(
        request()
            .withPath("/some/path")
            .withMethod("POST")
    );</code></pre>
        </div>
        <button class="accordion inner">JavaScript</button>
        <div class="panel">
            <pre class="prettyprint lang-javascript code"><code class="code">var mockServerClient = require('mockserver-client').mockServerClient;
mockServerClient("localhost", 1080)
    .retrieveLogMessages({
        "path": "/some/path",
        "method": "POST"
    })
    .then(
        function (logMessages) {
            // logMessages is a String[]
            console.log(logMessages);
        },
        function (error) {
            console.log(error);
        }
    );</code></pre>
            <p>See <a target="_blank" href="https://app.swaggerhub.com/apis/jamesdbloom/mock-server-openapi/{{ site.mockserver_api_version }}#/control/put_retrieve" target="_blank">REST API</a> for full JSON specification</p>
        </div>
        <button class="accordion inner">REST API</button>
        <div class="panel">
            <pre class="prettyprint code"><code class="code">curl -v -X PUT "http://localhost:1080/mockserver/retrieve?type=LOGS" -d '{
    "path": "/some/path",
    "method": "POST"
}'</code></pre>
            <p>See <a target="_blank" href="https://app.swaggerhub.com/apis/jamesdbloom/mock-server-openapi/{{ site.mockserver_api_version }}#/control/put_retrieve" target="_blank">REST API</a> for full JSON specification</p>
        </div>
    </div>
    <button id="button_retrieve_recorded_log_messages_as_array" class="accordion">retrieve recorded log messages as array</button>
    <div class="panel">
        <button class="accordion inner">Java</button>
        <div class="panel">
            <pre class="prettyprint lang-java code"><code class="code">String[] logMessages = new MockServerClient("localhost", 1080)
    .retrieveLogMessagesArray(
        request()
            .withPath("/some/path")
    );</code></pre>
        </div>
        <button class="accordion inner">JavaScript</button>
        <div class="panel">
            <pre class="prettyprint lang-javascript code"><code class="code">var mockServerClient = require('mockserver-client').mockServerClient;
mockServerClient("localhost", 1080)
    .retrieveLogMessages({
        "path": "/some/path"
    })
    .then(
        function (logMessages) {
            // logMessages is a String[]
            console.log(logMessages);
        },
        function (error) {
            console.log(error);
        }
    );</code></pre>
            <p>See <a target="_blank" href="https://app.swaggerhub.com/apis/jamesdbloom/mock-server-openapi/{{ site.mockserver_api_version }}#/control/put_retrieve" target="_blank">REST API</a> for full JSON specification</p>
        </div>
    </div>
</div>

<a id="logging-levels" class="anchor" href="#logging-levels">&nbsp;</a>

<h2>Logging</h2>

<p>All interactions with the MockServer are logged including setting up expectations, matching expectations, clearing expectations and verifying requests. The log can be particularly helpful when trying to debug why a test is failing or
    expectations are not being matched.</p>

<p>The following information is logged:</p>

<ul>
    <li><strong>WARN</strong> - exceptions, errors</li>
    <li><strong>INFO</strong> - all interactions with the MockServer including setting up expectations, matching expectations, clearing expectations and verifying requests</li>
    <li><strong>DEBUG</strong> - all matcher results, including when specific matchers fail (such as HeaderMatcher)</li>
    <li><strong>TRACE</strong> - low level details or exceptions that aren't usually considered an error</li>
</ul>

<p>The <strong>TRACE</strong> level logging results in a lot of verbose logging but can be very helpful to debug why a complex matcher (such as the JSON Schema matcher) is not matching.</p>

<p>To disable logging the following options can be used:</p>

<ul>
    <li><code class="code inline">-Dmockserver.logLevel=OFF</code> - to disable logging from the MockServer and Proxy classes</li>
    <li><code class="code inline">-Droot.logLevel=OFF</code> - to disable all logging from all other classes</li>
</ul>

<p>The following sections explain how to configure logging when running MockServer via:</p>
<ul>
    <li><a href="#logging_with_api">JUnit 4 @Rule, JUnit 5 Test Extension or Java API (i.e. maven or gradle project)</a></li>
    <li><a href="#logging_with_command_line">Command Line</a></li>
    <li><a href="#logging_with_maven_plugin">Maven Plugin</a></li>
    <li><a href="#logging_with_node">npm module or Grunt plugin</a></li>
</ul>

<a id="logging_with_api" class="anchor" href="#logging_with_api">&nbsp;</a>

<h3>Configuring logging for JUnit 4 @Rule, JUnit 5 Test Extension or Java API (i.e. maven or gradle project)</h3>

<p>MockServer uses SL4J for logging so if MockSever is being launched using the <a href="/mock_server/running_mock_server.html#junit_rule">JUnit 4 @Rule</a>, the <a href="/mock_server/running_mock_server.html#junit_test_extension">JUnit 5
    Test Extension</a>, <a href="/mock_server/running_mock_server.html#client_api">ClientAndServer</a> or directly using the <strong>org.mockserver.netty.MockServer</strong> the project launching MockServer needs to configure the logging
    output by configuring <a target="_blank" href="https://www.slf4j.org/faq.html">SLF4J</a>. MockServer relies on a SLF4J binding being on the classpath for logs to be output. The simplest approach is to use the Java Logger SLF4J binding.</p>

<p>In MockServer the Java Logger SLF4J binding is only an optional dependency. Therefore, when MockServer is added as a dependency to a Maven or Gradle project it does not pull in the Java Logger binding transitively.</p>

<p>If no existing SLF4J logger binding exists no logs will be output and the following error will be displayed by SLF4J:</p>

<pre><code class="code">SLF4J: Failed to load class "org.slf4j.impl.StaticLoggerBinder".
SLF4J: Defaulting to no-operation (NOP) logger implementation
SLF4J: See http://www.slf4j.org/codes.html#StaticLoggerBinder for further details.</code></pre>

<p>If this happens the simplest way to output logs for MockServer is to add the Java Logger SLF4J binding as a dependency. For example, in Maven this would be as follows:</p>

<pre><code class="code xml">&lt;<span class="element">dependency</span>&gt;
    &lt;<span class="element">groupId</span>&gt;org.slf4j&lt;/<span class="element">groupId</span>&gt;
    &lt;<span class="element">artifactId</span>&gt;slf4j-jdk14&lt;/<span class="element">artifactId</span>&gt;
    &lt;<span class="element">version</span>&gt;1.7.29&lt;/<span class="element">version</span>&gt;
&lt;/<span class="element">dependency</span>&gt;</code></pre>

<p>It is possible to configure the logger using a configuration file by specifying the <span class="string_literal">java.util.logging.config.file</span> system property, as follows.</p>

<pre><code class="code">-Djava.util.logging.config.file=/path/to/example_logging_configuration.properties</code></pre>

<p>It is possible to configure the logger programmatically, for example, as follows.</p>

<pre class="prettyprint lang-java code"><code class="code">ConfigurationProperties.logLevel("DEBUG");
String loggingConfiguration = "" +
    "handlers=org.mockserver.logging.StandardOutConsoleHandler\n" +
    "org.mockserver.logging.StandardOutConsoleHandler.level=ALL\n" +
    "org.mockserver.logging.StandardOutConsoleHandler.formatter=java.util.logging.SimpleFormatter\n" +
    "java.util.logging.SimpleFormatter.format=%1$tF %1$tT  %3$s  %4$s  %5$s %6$s%n\n" +
    ".level=" + javaLoggerLogLevel() + "\n" +
    "io.netty.handler.ssl.SslHandler.level=WARNING";
LogManager.getLogManager().readConfiguration(new ByteArrayInputStream(loggingConfiguration.getBytes(UTF_8)));</code></pre>

<a id="logging_with_command_line" class="anchor" href="#logging_with_command_line">&nbsp;</a>

<h3>Configuring logging via the Command Line</h3>

<p>When running MockServer directly from <a href="/mock_server/running_mock_server.html#running_from_command_line">the command line</a> the command line argument <span class="inline_code">-logLevel</span> can be used to set the log level,
    as follows:</p>

<pre><code class="code">java -jar ~/Downloads/mockserver-netty-{{ site.mockserver_version }}-no-dependencies.jar -serverPort <span class="numeric_literal">1080</span> -logLevel DEBUG</code></pre>

<p>Alternatively a system property <span class="inline_code">mockserver.logLevel</span> can be used to set the log level, as follows:</p>

<pre><code class="code">java -Dmockserver.logLevel=INFO -jar ~/Downloads/mockserver-netty-{{ site.mockserver_version }}-no-dependencies.jar -serverPort <span class="numeric_literal">1080</span></code></pre>

<h4>Configuring Java Logger</h4>

<p>When running MockServer from the command line it relies on the Java Logger <span class="inline_code">java.util.logging.Logger</span> in addition to controlling the log level of MockServer using <span class="inline_code">-logLevel</span>
    the underlying logging framework can be configured (overriding the default configuration) by specifying the System Property <span class="inline_code">java.util.logging.config.file</span> or <span class="inline_code">java.util.logging.config.class</span>
    as detailed in the <a target="_blank" href="https://docs.oracle.com/javase/8/docs/api/java/util/logging/LogManager.html">LogManager JavaDoc</a>.</p>

<p>The MockServer github repository contains an example <a target="_blank"href="https://github.com/mock-server/mockserver/blob/master/mockserver-netty/src/main/resources/example_logging_configuration.properties">Java Logger configuration file</a> (which
    would be configured using <span class="inline_code">java.util.logging.config.file</span>).</p>

<p>The default logging configuration can be overridden as follows:</p>
<pre><code class="code">java -Djava.util.logging.config.file=/path/to/example_logging_configuration.properties -jar ~/Downloads/mockserver-netty-{{ site.mockserver_version }}-no-dependencies.jar -serverPort <span class="numeric_literal">1080</span> -logLevel DEBUG</code></pre>

<a id="logging_with_maven_plugin" class="anchor" href="#logging_with_maven_plugin">&nbsp;</a>

<h3>Configuring logging via the Maven Plugin</h3>

<p>The mockserver-maven-plugin provides a logLevel settings that can be used to define the log level for all MockServer classes, as follows:</p>

<pre><code class="code xml">&lt;<span class="element">plugin</span>&gt;
     &lt;<span class="element">groupId</span>&gt;<span class="element_value">org.mock-server</span>&lt;/<span class="element">groupId</span>&gt;
     &lt;<span class="element">artifactId</span>&gt;<span class="element_value">mockserver-maven-plugin</span>&lt;/<span class="element">artifactId</span>&gt;
     &lt;<span class="element">version</span>&gt;<span class="element_value">{{ site.mockserver_version }}</span>&lt;/<span class="element">version</span>&gt;
     &lt;<span class="element">configuration</span>&gt;
        &lt;<span class="element">serverPort</span>&gt;<span class="element_value">1080</span>&lt;/<span class="element">serverPort</span>&gt;
        &lt;<span class="element">logLevel</span>&gt;<span class="element_value">DEBUG</span>&lt;/<span class="element">logLevel</span>&gt;
     &lt;/<span class="element">configuration</span>&gt;
     &lt;<span class="element">executions</span>&gt;
         &lt;<span class="element">execution</span>&gt;
             &lt;<span class="element">id</span>&gt;<span class="element_value">process-test-classes</span>&lt;/<span class="element">id</span>&gt;
             &lt;<span class="element">phase</span>&gt;<span class="element_value">process-test-classes</span>&lt;/<span class="element">phase</span>&gt;
             &lt;<span class="element">goals</span>&gt;
                 &lt;<span class="element">goal</span>&gt;<span class="element_value">runForked</span>&lt;/<span class="element">goal</span>&gt;
             &lt;/<span class="element">goals</span>&gt;
         &lt;/<span class="element">execution</span>&gt;
         &lt;<span class="element">execution</span>&gt;
             &lt;<span class="element">id</span>&gt;<span class="element_value">verify</span>&lt;/<span class="element">id</span>&gt;
             &lt;<span class="element">phase</span>&gt;<span class="element_value">verify</span>&lt;/<span class="element">phase</span>&gt;
             &lt;<span class="element">goals</span>&gt;
                 &lt;<span class="element">goal</span>&gt;<span class="element_value">stopForked</span>&lt;/<span class="element">goal</span>&gt;
             &lt;/<span class="element">goals</span>&gt;
         &lt;/<span class="element">execution</span>&gt;
     &lt;/<span class="element">executions</span>&gt;
 &lt;/<span class="element">plugin</span>&gt;</code></pre>

<a id="logging_with_node" class="anchor" href="#logging_with_node">&nbsp;</a>

<h3>Configuring logging via the npm module</h3>

<p>When running MockServer using the <a href="/mock_server/running_mock_server.html#mockserver_node"><strong>mockserver-node</strong></a> Grunt plugin and Node.js (npm) module the <span class="inline_code">verbose</span> option can be used
    to enable <strong>INFO</strong> level logging and the <span class="inline_code">trace</span> option can be used to enable <strong>TRACE</strong> level logging.</p>

<p>It is generally recommended to enable <span class="inline_code">verbose</span> which should provide the correct amount of information, <span class="inline_code">trace</span> is only required for very low level debugging.</p>

<pre class="prettyprint lang-java code"><code class="code">var mockserver = require('mockserver-node');

mockserver
    .start_mockserver({
        serverPort: 1080,
        verbose: true,
        trace: true
    })
    .then(
        function () {
            console.log("started MockServer");
        },
        function (error) {
            console.log(JSON.stringify(error));
        }
    );</code></pre>

<h3>Configuring logging via the Grunt plugin</h3>

<p>When running MockServer using the <a href="/mock_server/running_mock_server.html#mockserver_node"><strong>mockserver-node</strong></a> as a Grunt plugin module the <span class="inline_code">verbose</span> option can be used to enable
    <strong>INFO</strong> level logging and the <span class="inline_code">trace</span> option can be used to enable <strong>TRACE</strong> level logging. The <span class="inline_code">--verbose</span> command line flag can also be used to
    enable the <strong>mockserver-node</strong> verbose option from the command line.</p>

<p>It is generally recommended to enable <span class="inline_code">verbose</span> which should provide the correct amount of information, <span class="inline_code">trace</span> is only required for very low level debugging.</p>

<pre class="prettyprint lang-java code"><code class="code">grunt.initConfig({
        start_mockserver: {
            options: {
                serverPort: 1080,
                verbose: true,
                trace: true
            }
        },
        stop_mockserver: {
            options: {
                serverPort: 1080
            }
        }
});

grunt.loadNpmTasks('mockserver-node');</code></pre>
